package org.bminfo.migle.parser;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;

public class CommandExecutor {
	public synchronized void cmdExec(String cmdName, String path) throws IOException{

		Process proc = Runtime.getRuntime().exec(cmdName, null, new File(path)); 

		String str;
		BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(proc.getInputStream())); 
		while ( (str=bufferedReader.readLine()) != null)
			System.out.println(str); 

		try{
			System.out.println(proc.waitFor());
			System.out.println("Wait!");
		}catch(InterruptedException e){
			System.out.println("These is an Interrupted Exception!");
		}
	}
}
